from pluginsystem.PluginBase import Plugin
import os.path

class Readme_html(Plugin):
    def __init__(self):
        self.set_keyword("Readme HTML")
        self.set_mime_type("TEXT/HTML")
        
    def check(self, config):         
        return os.path.exists(self.get_file(config))

    def get_file(self, config):
        docdir = self.get_documentation_path()
        basedir = config["basedir"]
        if config.has_key("README_html"):
            readme = config["README_html"]
        else:
            readme = "README.html"                
        fullpath = os.path.join(docdir,basedir,readme)
        return fullpath        